/**
 * Created by Xiaoming on 2017/9/21.
 */
angular.module('service.sharewithd',[
        'ngResource'
    ])
    .service('ShareWithdService', ['$http','$resource',function($http,$resource){
        this.getYue = function(userid){
            var resource = $resource(usercenterUrl+"userbalance/:userid");
            return resource.get({userid:userid});
        };
        //佣金提现操作
        this.insertWithd = function(withd,success,error){
            var resource = $resource(shareUrl+"share_Withd/insert");
            return resource.save(withd,success,error);
        };
        //更新用户余额
        this.updateUserBalance = function(data,success,error){
            var resource = $resource(usercenterUrl+"userbalance/:userid");
            return resource.save({userid:data.userid},data,success,error);
        };
        //查看提现记录
        this.ShareWith = function(userid,shopid){
            var resource = $resource(shareUrl+"share_Withd/ShareWith/:shopid/:userid");
            return resource.query({userid:userid,shopid:shopid});
        }
    }])